using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter04
{
	/// <summary>
	/// Example09: Over the Rise
	/// A car exhibits a constant acceleration of 0.300 m/s^2 
	/// parallel to the roadway. The car passes over a rise in 
	/// the roadway such that the top of the rise is shaped like 
	/// a circle of radius 500m. At the moment the car is at the 
	/// top of the rise, its velocity vector is horizontal and 
	/// has a magnitude of 6.00 m/s. What is the direction of the 
	/// total acceleration vector for the car at this instant?
	/// a = 0.309 m/s^2,   \phi = -13.5^{\circle}
	/// </summary>
	public class Example09
	{
		public Example09()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			// a = ah + av;
			L.Acceleration ah = new L.Acceleration();
			ah.X = 0.3;
			L.Acceleration av = new L.Acceleration();
			av.Y = -6.0*6.0/500.0;    // v^2/r;
			L.Vector a = ah + av;
			result += Convert.ToString(a.Norm);
			result += "    "+Convert.ToString(Math.Atan(a.Y/a.X)*180.0/Math.PI);
		}
	}
}
